<template>
  <a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
    <a-form-model-item label="姓名">
      <a-input v-model="form.name" />
    </a-form-model-item>
    <a-form-model-item label="ID">
      <a-input v-model="form.ID" />
    </a-form-model-item>
    <a-form-model-item label="请假类型">
      <a-select v-model="form.region" placeholder="请选择请假类型">
        <a-select-option value="出差">
          出差
        </a-select-option>
        <a-select-option value="年假">
          年假
        </a-select-option>
	<a-select-option value="病假">
          病假
        </a-select-option>
        <a-select-option value="婚嫁">
          婚假
        </a-select-option>
	<a-select-option value="产检假">
          产检假
        </a-select-option>
        <a-select-option value="产假">
          产假
        </a-select-option>
	<a-select-option value="哺乳假">
          哺乳假
        </a-select-option>
        <a-select-option value="陪产假">
          陪产假
        </a-select-option>
	<a-select-option value="事假">
          事假
        </a-select-option>
      </a-select>
    </a-form-model-item>
    <a-form-model-item label="开始日期">
      <a-date-picker
        v-model="form.date1"
        show-time
        type="date"
        placeholder="请选择日期"
        style="width: 100%;"
      />
    </a-form-model-item>
    <a-form-model-item label="结束日期">
      <a-date-picker
        v-model="form.date2"
        show-time
        type="date"
        placeholder="请选择日期"
        style="width: 100%;"
      />
    </a-form-model-item>
    <a-form-model-item label="请假原因">
      <a-input v-model="form.desc" type="textarea" />
    </a-form-model-item>
    <a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
      <a-button type="primary" @click="onSubmit">
        提交
      </a-button>
      <a-button style="margin-left: 10px;" @click="resetForm">
        取消
      </a-button>
    </a-form-model-item>
  </a-form-model>
</template>
<script>
export default {
  name: "Apply",
  props: {
    name: String,
  },
  data() {
    return {
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      form: {
        name: '',
        region: undefined,
        date1: undefined,
        delivery: false,
        type: [],
        resource: '',
        desc: '',
      },
    };
  },
  methods: {
    onSubmit() {
      console.log('submit!', this.form);
    },
    resetForm() {
      this.$refs.ruleForm.resetFields();
    },
  },
};
</script>